<%@ page import="java.util.Date" %>
<%@ page import="com.javaweb.common.StringTool" %><%--
  Function: 
  User: PING
  Date: 2022/9/22

--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String name = "zhangsan" ;
    Date now = new Date() ;
    // caching the date in following Objects
    /**
     * Object:
     *  1. pageConext
     *  2. request
     *  3. session
     *  4. application
     *
     */
    // 1. pageConext
 /*   pageContext.setAttribute("name", name);
    pageContext.setAttribute("time", now);*/
 // 2. put data into the request Obj
//    request.setAttribute("name", name);
//    request.setAttribute("time", now);
    // 3. put data into the session object
//    session.setAttribute("name", name);
//    session.setAttribute("time", now);
    // 4. put data into the application object
    application.setAttribute("name", name);
    application.setAttribute("time", now);

 %>
<html>
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<%
    // get the cached data from Objects
    // pageContext obj
  /*  String gotName = (String) pageContext.getAttribute("name") ;
    Date nowDate = (Date) pageContext.getAttribute("time") ;*/
  /*
      dispatcher at server side
   */
  /*request.getRequestDispatcher("01_scope_show.jsp").forward(request, response);*/
    /**
     * redirect at client side.
     */
  response.sendRedirect("01_scope_show.jsp");
%>
<%--<jsp:forward page="01_scope_show.jsp"/>--%>

</body>
</html>
